package com.huika.dealontop.control.homepage.database;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

/**
 * Created by cailu on 2015/12/1.
 */
public class DindanDB extends SQLiteOpenHelper {
    public static final String DINDANTB = "dindan_tb";//表名
    public static final String TIME = "time";//时间
    public static final String IMAGEURL = "imageurl";//图片地址
    public static final String CONTENT = "content";//文字内容
    public static final String PROJECT_ID = "project_id";//项目id
    public static final String ISSELECTED = "isselected";//项目id

    public DindanDB(Context context) {
        super(context, "dindan.db", null, 2);
    }

    @Override
    public void onCreate(SQLiteDatabase db) {
        db.execSQL("create table dindan_tb(_id integer primary key autoincrement,project_id text,time integer,imageurl text,content text,isselected integer)");
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
        db.execSQL("drop table dindan_tb");
        onCreate(db);
    }
}
